﻿(function () {
    qweb.defineGlobal("qweb.api.actions");
    Object.extend(qweb.api.actions, {
        getall: function (options, callback, onerror, resultprepare) {
            if (qweb.embedStorage.qweb__actions) {
                if (callback) {
                    callback(qweb.embedStorage.qweb__actions);
                } else {
                    return qweb.embedStorage.qweb__actions;
                }
            } else {
                return qweb.call("qweb.actions", options, callback, onerror, resultprepare);
            }
        },
        get: function (name, hidebinders, callback, onerror) {
            options = { namefilter: '^' + name + '$', showbinders: !hidebinders };
            return this.getall(options, callback, onerror, function (r) { return r[0]; });
        }
    });
})();